package com.yxq.mdt.app.modules.socialcontact.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

public class ExamplePagerAdapter extends FragmentPagerAdapter {
    private List<String> mTabBeanList;
    private List<Fragment> mFragments;

    public ExamplePagerAdapter(FragmentManager fm, List<Fragment> dataList, List<String> mTabBeanList) {
        super(fm);
        this.mTabBeanList = mTabBeanList;
        this.mFragments = dataList;

    }

    public void addPage(Fragment fragment) {
        mFragments.add(fragment);
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public Fragment getItem(int i) {
        return mFragments.get(i);
    }


    @Override
    public CharSequence getPageTitle(int position) {
        return mTabBeanList.get(position);
    }
}